/**
 * 1
 *  
 * @Author : Ruoyu Wang
 * @DateTime : 24-9-14 下午2:26
 */

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

class Solution {
public:
    /**
     * Note: 类名、方法名、参数名已经指定，请勿修改
     *
     *
     *
     * @param goods_list int整型 vector 商品价值
     * @param balance int整型  余额
     * @return int整型
     */
    int pickGoods(vector<int> &goods_list, int balance) {
        int f[goods_list.size()];
        int res = 0;
        for (int i = 0; i < goods_list.size(); ++i) {
            f[i] = 0;
            if (balance >= goods_list[i]) {
                f[i] = goods_list[i];
            }
            for (int j = 0; j < i; ++j) {
                if (f[j] + goods_list[i] <= balance) {
                    f[i] = max(f[i], f[j] + goods_list[i]);
                }
            }
            res = max(res, f[i]);
        }
        return res;
    }
};

int main() {

    return 0;
}